package com.example.administrator.testxingpiao.ui.main.homepage;


import com.example.administrator.testxingpiao.bean.HomePageBean;
import com.example.administrator.testxingpiao.httputils.HttpUtils;

import java.util.HashMap;

/**
 * Created by Administrator on 2016/8/4.
 */
public class HomePagePresenter implements HomePageContract.Presenter{

    private HomePageContract.View view;
    private HomePageContract.Model model;

    public HomePagePresenter(HomePageContract.View view,HomePageContract.Model model){

        this.view = view;
        this.model = model;
    }

    @Override
    public void initData(HashMap<String, String> params) {
        model.getHomePageBean(params, new HttpUtils.HttpCallBack<HomePageBean>(){
            @Override
            public void onSuceess(HomePageBean homePageBean) {
                view.onSuccessGetHomePageBean(homePageBean);
            }

            @Override
            public void onFail() {
                view.onFailGetHomePageBean("加载失败啦！");
            }
        });
    }
}
